package com.xhdx.pattern.decorator;
/**
 * 测试类
 *
 */
public class DecoratorDemo {

    public static void main(String[] args) {
        IColor red = new Red();
        AbsDecorator decorator = new DecoratorA(red);
        decorator.addColor();
        decorator = new DecoratorB(new DecoratorA(red));
        decorator.addColor();
        System.out.println("======");
        IColor black = new Black();
        decorator = new DecoratorA(black);
        decorator.addColor();
        decorator = new DecoratorB(new DecoratorA(black));
        decorator.addColor();

    }

}
